package ink.xiaobaibai.config;

import ink.xiaobaibai.service.IJumpService_V2;
import ink.xiaobaibai.service.monthly.IDelayTimedTaskService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;

/**
 * @description: 定时任务配置类
 * @author: 小白白
 * @create: 2021-06-03
 **/

@Configuration
@EnableScheduling
public class SchedulingConfig {

    @Autowired
    private IDelayTimedTaskService delayTimedTaskService;

    @Autowired
    private IJumpService_V2 jumpService_v2;

    /**
     * 每天0点01分录入开启状态的定时任务
     */
    @Scheduled(cron = "0 0 0 * * ?")
    private void autoGenerateReport() {
        this.delayTimedTaskService.initTodayTimedTask();
        this.jumpService_v2.refreshMap();
    }

}
